<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="parent">
      
        <div id="good">good</div>
    </div>
    <script>
        // 增删改查
        var parent=document.getElementById("parent");
        var p=document.createElement("p");
        var good=document.getElementById("good");
        console.log(p);
        p.innerHTML="hello world";
        // appendChild()
        // 给元素增加节点  不过是往后面增加元素
        parent.appendChild(p);
        /* removeChild() 从DOM树上移除一个元素 */
        parent.removeChild(good);
    </script>
</body>

</html>